package com.ysd.lis.controller.lab;


import cn.hutool.core.bean.BeanUtil;
import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.SysMenu;
import com.ysd.lis.entity.lab.LabItemDictRefer;
import com.ysd.lis.request.menuAddParam;
import com.ysd.lis.service.lab.LabItemDictReferService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 报告项目参考范围 前端控制器
 * </p>
 *
 * @author bai
 * @since 2024-01-22
 */
@RestController
@RequestMapping("/lab/itemDictRefer")
public class LabItemDictReferController extends BaseController {
    @Autowired
    private LabItemDictReferService itemDictReferService;

    @ApiOperation("获取参考范围信息")
    @GetMapping("/findItemDictRefer")
    public Result findItemDictRefer(LabItemDictRefer labItemDictRefer) {
        return itemDictReferService.findItemDictRefer(labItemDictRefer);
    }

    @ApiOperation("添加参考范围")
    @PostMapping("/addItemDictRefer")
    @LogDetail(requestParam ="addItemDictRefer",operationType = OperationType.INSERT, module = "检验管理" , businessName = "itemDictName",content = "新增【itemDictName】参考范围操作")
    public Result addItemDictRefer(@RequestBody LabItemDictRefer itemDictRefer){
        return itemDictReferService.addItemDictRefer(itemDictRefer);
    }

    @ApiOperation("修改参考范围")
    @PostMapping("/editItemDictRefer")
    @LogDetail(requestParam ="editItemDictRefer",operationType = OperationType.UPDATE, module = "检验管理", businessName = "itemDictName", content = "修改【itemDictName】参考范围操作")
    public Result editItemDictRefer(@RequestBody LabItemDictRefer itemDictRefer){
        return itemDictReferService.editItemDictRefer(itemDictRefer);
    }

    @ApiOperation("删除参考范围")
    @PostMapping("/deleteItemDictRefer")
    @LogDetail(requestParam ="deleteItemDictRefer",operationType = OperationType.UPDATE, module = "检验管理", businessName = "itemDictName", content = "修改【itemDictName】参考范围操作")
    public Result deleteItemDictRefer(@RequestBody LabItemDictRefer itemDictRefer){
        return itemDictReferService.deleteItemDictRefer(itemDictRefer);
    }

}
